package ${packageName}.mapper;

import ${packageName}.pojo.${modelName};
import ${packageName}.result.Parameter;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
<#if plugin.enableMybatisplus>
import ${packageName}.common.CommonMybatisPlusMapper;
</#if>

@Mapper
public interface ${mapperName} <#if plugin.enableMybatisplus> extends CommonMybatisPlusMapper<${modelName}></#if>{



<#if !plugin.enableMybatisplus>
    /**
    *增加${remarksTable}数据
    **/
    int insert${modelName}(${modelName} record);
    <#if primaryKeyColumns ?has_content  && (primaryKeyColumns?size > 0)>
        /**
        *删除${remarksTable}数据
        **/
        int delete${modelName}ByPrimaryKey(<#list primaryKeyColumns as column><#if column_index != 0> , </#if>@Param("${column.propertyName?uncap_first}") ${column.javaType} ${column.propertyName?uncap_first} </#list>);
    </#if>

    <#if primaryKeyColumns ?has_content  && (primaryKeyColumns?size > 0)>
        /**
        * 通过主键删除多条${remarksTable}数据
        **/
        int delete${modelName}ByIds(<#list primaryKeyColumns as column><#if column_index != 0> , </#if>@Param("${column.propertyName?uncap_first}s") String ${column.propertyName?uncap_first}s </#list>);
    </#if>


    <#if primaryKeyColumns ?has_content  && (primaryKeyColumns?size > 0)>
        /**
        * 更新${remarksTable}数据
        **/
        int update${modelName}ByPrimaryKey(${modelName} record);
    </#if>
    <#if primaryKeyColumns ?has_content  && (primaryKeyColumns?size > 0)>
        /**
        * 更新属性不为空${remarksTable}数据
        **/
        int update${modelName}ByPrimaryKeyNotNull(${modelName} record);
    </#if>

    <#if primaryKeyColumns ?has_content  && (primaryKeyColumns?size > 0)>
        /**
        * 通过主键查询${remarksTable}数据
        **/
        ${modelName} select${modelName}ByPrimaryKey(<#list primaryKeyColumns as column><#if column_index != 0> , </#if>@Param("${column.propertyName?uncap_first}") ${column.javaType} ${column.propertyName?uncap_first} </#list>);
    </#if>
    List<${modelName}> getAll${modelName}s();
</#if>


/**
* 通过条件查询${remarksTable}数据
**/
List<${modelName}> select${modelName}(@Param("parameter")Parameter<${modelName}> parameter);

/**
*总条数
**/
long get${modelName}PageCount(@Param("parameter")Parameter<${modelName}> parameter);
/**
* 分页条件查询${remarksTable}
**/
List<${modelName}> get${modelName}Page(@Param("parameter")Parameter<${modelName}> parameter);


}